package com.cloud.seata.order.service.impl;

import com.cloud.seata.order.feign.StockClient;
import com.cloud.seata.order.mapper.OrderMapper;
import com.cloud.seata.order.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @Resource
    private StockClient stockClient;

    @Override
    public String create(Boolean flag) {
        stockClient.decr(flag);
        orderMapper.create();
        return "创建订单成功";
    }

}
